<template>
  <div id="app">
    <router-view name="headnav"></router-view>
    <router-view />
    <router-view name="footer"></router-view>
  </div>
</template>
<script>
export default {
  created() {
    if(localStorage.getItem("store")){
      this.$store.replaceState(
        Object.assign(
          {},
          this.$store.state,
          JSON.parse(localStorage.getItem("store"))
        )
      )
    }
    window.addEventListener('beforeunload', () => {
      localStorage.setItem("store", JSON.stringify(this.$store.state))
    })
  }
}
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  
}

* {
  margin: 0;
  padding: 0;
}

.active {
  background-color: rgba(255, 255, 255, 0.2);
  color: #000;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
